<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" th:href="@{/css/main.css}"/>
    <title>Spring MVC5 + Thymeleaf 表单示例</title>
</head>
<body>
<h2>Spring MVC5 + Thymeleaf 表单示例</h2>
<form th:action="@{/saveProduct}" th:object="${product}" method="post">
    <label>产品名称1:</label>
    <!--  直接获取上面${product}的value -->
    <input type="text" th:field="*{description}" value=""/><br/>

    <label>有效日期2:</label>
    <input type="text" th:field="*{availableFrom}" value="2018-03-28"/> <br/>

    <label>价格3 (RMB):</label>
    <input type="text" th:field="${product.price}" size="10" value="198"/><br/>

    <input type="submit" value="submit"/>
</form>
</body>
</html>